<?php

namespace App\Http\Controllers\web;

use App\Http\Controllers\Controller;
use App\Repository\RepositoryInterface\HeadsInterface;
use Illuminate\Http\Request;

class HeadController extends Controller
{
    protected $head;

    public function __construct(HeadsInterface $heads){
        $this->head = $heads;
    }
    /**
     * 团长申请
     * @param Request $request
     * @return array
     */
    public function applyHead(Request $request){
        $params = $request->all();
        return $this->head->applyHead($params);
    }

    /**
     * 团长列表
     * @param Request $request
     * @return array
     */
    public function headList(Request $request){
        $params = $request->all();
        return  $this->head->headList($params);
    }

    /**
     * 审核状态列表
     * @param Request $request
     * @return array
     */
    public function headStatus(Request $request){
        $status = $request->input('status');
        return  $this->head->headStatus($status);
    }

    /**
     * 通过/不通过
     * @param Request $request
     * @return array
     */
    public function adopt(Request $request){
        $params = $request->all();
        return  $this->head->adopt($params);
    }

    /**
     * 团长管理列表
     * @param Request $request
     * @return mixed
     */
    public function adminHeadList(Request $request){
        $params = $request->all();
        return  $this->head->adminHeadList($params);
    }

    /**
     * 团长修改
     * @param Request $request
     * @return mixed
     */
    public function adminUpdateHead(Request $request){
        $params = $request->all();
        return $this->head->adminUpdateHead($params);
    }
    /**
     * 团长名称es搜索
     * @param $params
     * @return \Illuminate\Http\JsonResponse
     */
    public function search(Request $request){
        $params = $request->input('keyword');
        return $this->head->search($params);
    }

}
